package com.dmatek.uwb.packet.bean;

import java.util.ArrayList;
import java.util.List;

import com.dmatek.uwb.util.tool.StringUtil;
import com.dmatek.uwb.xml.dom.bean.BasePath;
import com.dmatek.uwb.xml.dom.bean.Divider;
import com.dmatek.uwb.xml.dom.bean.Point;
/***
 * 
 * @author zf
 * @data 2019年6月17日 下午1:52:14
 * @Description
 *  调试的信息类
 */
public class AssistLocation {
	private Point place;
	private List<ENodeBDistance> assistRefers, matchBranchs, 
								mainRefers, dismatchBranchs;
	private BasePath assistPath;
    private StringBuilder des;
    private boolean isTrigger = false;
    private List<Divider> assistDividers;
	public AssistLocation() {
		super();
		assistRefers = new ArrayList<ENodeBDistance>();
		matchBranchs = new ArrayList<ENodeBDistance>();
		mainRefers = new ArrayList<ENodeBDistance>();
		dismatchBranchs = new ArrayList<ENodeBDistance>();
		assistDividers = new ArrayList<Divider>();
		des = new StringBuilder();
	}
	public AssistLocation(Point place, List<ENodeBDistance> assistRefers,
			List<ENodeBDistance> matchBranchs, List<ENodeBDistance> mainRefers,
			List<ENodeBDistance> dismatchBranchs, BasePath assistPath,
			StringBuilder des, boolean isTrigger, List<Divider> assistDividers) {
		super();
		this.place = place;
		this.assistRefers = assistRefers;
		this.matchBranchs = matchBranchs;
		this.mainRefers = mainRefers;
		this.dismatchBranchs = dismatchBranchs;
		this.assistPath = assistPath;
		this.des = des;
		this.isTrigger = isTrigger;
		this.assistDividers = assistDividers;
	}
	public Point getPlace() {
		return place;
	}
	public void setPlace(Point place) {
		this.place = place;
	}
	public List<ENodeBDistance> getAssistRefers() {
		return assistRefers;
	}
	public void setAssistRefers(List<ENodeBDistance> assistRefers) {
		this.assistRefers = assistRefers;
	}
	public List<ENodeBDistance> getMatchBranchs() {
		return matchBranchs;
	}
	public void setMatchBranchs(List<ENodeBDistance> matchBranchs) {
		this.matchBranchs = matchBranchs;
	}
	public List<ENodeBDistance> getMainRefers() {
		return mainRefers;
	}
	public void setMainRefers(List<ENodeBDistance> mainRefers) {
		this.mainRefers = mainRefers;
	}
	public List<ENodeBDistance> getDismatchBranchs() {
		return dismatchBranchs;
	}
	public void setDismatchBranchs(List<ENodeBDistance> dismatchBranchs) {
		this.dismatchBranchs = dismatchBranchs;
	}
	public BasePath getAssistPath() {
		return assistPath;
	}
	public void setAssistPath(BasePath assistPath) {
		this.assistPath = assistPath;
	}
	public StringBuilder getDes() {
		return des;
	}
	public void setDes(StringBuilder des) {
		this.des = des;
	}
	public boolean isTrigger() {
		return isTrigger;
	}
	public void setTrigger(boolean isTrigger) {
		this.isTrigger = isTrigger;
	}
	public List<Divider> getAssistDividers() {
		return assistDividers;
	}
	public void setAssistDividers(List<Divider> assistDividers) {
		this.assistDividers = assistDividers;
	}
	public void addAssistRefers(ENodeBDistance... eNodeBDistances) {
		for (ENodeBDistance eNodeBDistance : eNodeBDistances) {
			if(!contain(eNodeBDistance.getId())) {
				getAssistRefers().add(eNodeBDistance);
			}
		}
	}
	private boolean contain(String id) {
		if(!StringUtil.isEmpty(id)) {
			for (ENodeBDistance eNodeBDistance : getAssistRefers()) {
				if(id.equalsIgnoreCase(eNodeBDistance.getId())) {
					return true;
				}
			}
		}
		return false;
	}
	@Override
	public String toString() {
		return "AssistLocation [place=" + place + ", des=" + des
				+ ", isTrigger=" + isTrigger + "]";
	}
}
